/*
 * @Author: yuanweijiang
 * @Date: 2024-01-11 09:46:55
 * @LastEditors: XHM
 */
import request from '/@/utils/request';

export const pageList = (data: any) => {
	return request({
		url: '/geoserver/geoLayer/findLayerPageList',
		method: 'post',
		data,
	});
};

export const addGeoLayer = (data: any) => {
	return request({
		url: '/geoserver/geoLayer/publishGeoLayer',
		method: 'post',
		data,
	});
};

//原生边界框 计算
export const getBorderCalculation = (data: any) => {
	return request({
		url: '/geoserver/geoLayer/getBorderCalculation',
		method: 'post',
		data,
	});
};
// 根据图层id查询图层详细信息
export const getGeoBoxDataInfo = (id: any) => {
	return request({
		url: '/geoserver/geoLayer/getLayerManager/?layerManagerId=' + id,
		method: 'get',
	});
};



//经纬度边框 计算
export const getGeoBoxLatLonData = (data: any) => {
	return request({
		url: '/geoserver/geoLayer/getGeoBoxLatLonData',
		method: 'post',
		data,
	});
};

export const deleteGeoLayer = (data: any) => {
	return request({
		url: '/geoserver/geoLayer/delGeoLayer',
		method: 'post',
		data,
	});
};

export function getInfoById(id?: string) {
	return request({
		url: '/geoserver/geoLayer/getGeoBoxLatLonData/?layerManagerId=' + id,
		method: 'get',
	});
}

export const updateGeoLayer = (data: any) => {
	return request({
		url: '/geoserver/geoLayer/updateGeoLayer',
		method: 'post',
		data,
	});
};

export const editStatus = (data: any) => {
	return request({
		url: '/geoserver/geoLayer/updateLayerStatus',
		method: 'post',
		data,
	});
};

// 查询当前数据源下的可发布的空间数据的表列表 
export const getTableDataSourceInfo= (data: any) => {
	return request({
		url: '/geoserver/fileDataSource/getTableDataSourceInfoVo',
		method: 'post',
		data,
	});
};


// 查询左侧图层组目录图层 
export const getAllWorkSpaceList = (data: any) => {
	return request({
		url: '/geoserver/geoWork/getAllWorkSpaceList',
		method: 'post',
		data,
	});
};

// 修改图层标签内容
export const updateLabel = (data: any) => {
	return request({
		url: '/geoserver/geoLayer/updateLayerLabel',
		method: 'post',
		data,
	});
};

// 修改图层启用状态 
export const updateLayerStatus = (data: any) => {
	return request({
		url: '/geoserver/geoLayer/updateLayerPublishStatus',
		method: 'post',
		data,
	});
};